package cn.cheery.springboot.service.impl;

import cn.cheery.springboot.entity.UserInfo;
import cn.cheery.springboot.mapper.UserInfoMapper;
import cn.cheery.springboot.service.IUserInfoService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author Cheery
 * @since 2021-06-30
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class UserInfoServiceImpl extends ServiceImpl<UserInfoMapper, UserInfo> implements IUserInfoService {
    @Autowired
    UserInfoMapper userInfoMapper;

    /**
     * 通过账号查询用户
     * @param username
     * @return
     */
    public UserInfo findByUsername(String username){
        return userInfoMapper.findByUsername(username);
    }
}
